package org.bronycorps.mlptss.manager;

import java.util.HashMap;
import java.util.Map;

import org.bronycorps.mlptss.domain.model.AbstractBulletType;
import org.bronycorps.mlptss.domain.model.BulletType;
import org.bronycorps.mlptss.domain.model.SpecialBulletType;
import org.bronycorps.mlptss.manager.preferences.AssetsConfiguration.SpecialAttackConfiguration;

public class BulletFactory {
	private final static Map<String, AbstractBulletType> pool = new HashMap<String, AbstractBulletType>();

	public static BulletType getBulletType(String name) {
		if (!pool.containsKey(name)) {
			pool.put(name, new BulletType(name));
		}
		return (BulletType) pool.get(name);
	}

	public static SpecialBulletType getSpecialBulletType(String name) {
		return (SpecialBulletType) pool.get(name);
	}

	public static void loadSpecialBulletType(SpecialAttackConfiguration config) {
		pool.put(config.getName(), new SpecialBulletType(config));
	}

}
